<html>
<head>
<title>Login</title>
<?php oh("extjs")->css(); ?>
<?php oh("extjs")->bootstrap(); ?>
		
<script type="text/javascript">

var seed = "" + (10000000 + Math.floor(Math.random() * 90000000));

Ext.require(['*']);

Ext.onReady(function() {
	Ext.QuickTips.init();
	//Ext.state.Manager.setProvider(Ext.create('Ext.state.CookieProvider'));
	Ext.Component.prototype.stateful = false;
	
	 var simple = Ext.create('Ext.form.Panel', {
        url:'?page=auth',
        frame:true,
        title: 'Simple Form (username: admin, password: admin)',
        bodyStyle:'padding:5px 5px 0',
        width: 350,
        fieldDefaults: {
            msgTarget: 'side',
            labelWidth: 75
        },
        defaultType: 'textfield',
        defaults: {
            anchor: '100%'
        },
		style: {
		marginLeft: 'auto',
        marginRight: 'auto',
		marginTop: '50px'
		},
        items: [{
            fieldLabel: 'Username',
            name: 'username',
            allowBlank:false
        },{
            fieldLabel: 'Password',
            name: 'password'
        }],

        buttons: [{
            text: 'Login',
			handler:  function() {
				var form = this.up('form').getForm();
				if (form.isValid()) {
					form.submit({
						success: function(form, action) {
						   Ext.Msg.alert('Success', action.result.msg);
						   window.location = '?';
						},
						failure: function(form, action) {
							Ext.Msg.alert('Failed', action.result.msg);
						}
					});
				}
			}
        }]
    });

    simple.render(document.body);
	
	


});
</script>
</head>
<body>


</body>
</html>
 